import org.junit.Test;

import java.util.*;

public class Main {
    private static final Map<Integer,String> MAP = new HashMap<>();
    private static final Random RANDOM = new Random();
    public static void main(String[] args) {
        MAP.put(1,"动态数组");
        MAP.put(2,"链表");
        MAP.put(3,"栈与队列");
        MAP.put(4,"二叉树");
        MAP.put(5,"TreeMap|HashMap二选一");
        MAP.put(6,"二叉堆");
        //MAP.put(7,"Trice");

        random(MAP);
    }

    public static void random(Map<Integer, String> map){
        int num = RANDOM.nextInt(6) + 1;
        System.out.println("num="+num);
        Set<Map.Entry<Integer, String>> entries = map.entrySet();
        for (Map.Entry<Integer, String> entry : entries) {
            if(num == entry.getKey()){
                System.out.println(entry.getValue());
            }
        }
    }


}
